#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Taotie Ren

# user = 'ttr'
# passwd = 'ttr'
# counter = 0
# counter_err = 0
#
# for i in range(10):
#     if counter < 3:
#         username = input("username:")
#         password = input("password:")
#         if user == username and passwd == password:
#             print("Welcome login ")
#             break
#         else:
#             print("username or password is invalid ")
#             # for i in range(10):
#             counter_err += 1
#             if counter_err < 3:
#                 with open("user.txt", "w") as f:
#                     f.write("username")
#                     counter_err = 0
#                     # break
#             # else:
#             #     continue
#     else:
#         continue_confirm = input("Do you want too:")
#         if continue_confirm == 'y':
#             # counter = 0
#             continue
#         # pass #i = 0
#         else:
#             break
#     counter += 1
import getpass

user,passwd = 'ttr','ttr123'

username = input("username:")
password = getpass.getpass("password:")

if user == username and passwd == password:
    print("welcome")
else:
    print("wrong username or password!")
